package com.zcn.io.web.service;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import com.zcn.io.web.api.entity.AnswerRecordTaskDtl;
import com.zcn.io.web.mapper.AnswerRecordTaskDtlMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.util.IdGenerator;

import java.util.List;

/**
 * @desc:
 * @author: 202438 邱建伟
 * @date: 2024/11/3 18:12
 * @Copyright (c) 2024, 江苏金恒信息科技股份有限公司
 */
@Service
@AllArgsConstructor
public class AnswerRecordTaskDtlService {

    private final AnswerRecordTaskDtlMapper answerRecordTaskDtlMapper;

    public void saveAll(List<AnswerRecordTaskDtl> saveList) {
        if (CollectionUtil.isEmpty(saveList)){
            return;
        }
        answerRecordTaskDtlMapper.saveBatch(saveList);
    }

    public void deleteAllByMainId(String mainId) {
        answerRecordTaskDtlMapper.deleteByMainId(mainId);
    }
}
